import request from '@/utils/request';

//获取视频列表
export const queryList = (params, current, limit, companyId) => {
    return request({
        url: '/edu/videos/pageVideoCondition/' + companyId + '/' + current + '/' + limit,
        method: 'post',
        data: params

    })
}

//新增视频信息
export const addVideoInfo = (params, companyId) => {
    return request({
        url: '/edu/videos/addVideos/' + companyId,
        method: 'post',
        data: params

    })
}

//修改视频信息
export const modifyVideoInfo = (params) => {
    return request({
        url: '/edu/videos/updateVideo',
        method: 'post',
        data: params

    })
}

//修改视频状态
export const updateStatus = (id, status) => {
    return request({
        url: '/edu/videos/publishVideo/' + id + '/' + status,
        method: 'post',
    })
}

//删除视频
export const removeVideo = (id) => {
    return request({
        url: '/edu/videos/deleteVideos/' + id,
        method: 'delete',
    })
}

//获取视频资源ID
export const getVideoSourceId = (id) => {
    return request({
        url: '/edu/videos/getVideoSourceId',
        method: 'get',
        params: { id }
    })
}

//查看视频所有学习记录
export const getRecordsByVideoId = (videoId) => {
    return request({
        url: '/edu/videoRecord/getRecordsByVideoId',
        method: 'get',
        params: { videoId }
    })
}

//获取视频播放地址
export const getVideoUrl = (videoSourceId) => {
    return request({
        url: '/vod/getPlayUrl',
        method: 'get',
        params: { videoSourceId }
    })
}

//获取视频播放凭证
export const getVideoAuth = (videoSourceId) => {
    return request({
        url: '/vod/getPlayAuth',
        method: 'get',
        params: { videoSourceId }
    })
}
